<template>
  <div>
    <el-tabs v-model="activeName" v-if="comfirm">
      <el-tab-pane label="我的商品" name="GoodManage">
        <GoodManage></GoodManage>
      </el-tab-pane>
      <el-tab-pane label="我的订单" name="HanderGood">
        <HanderGood></HanderGood>
      </el-tab-pane>
      <el-tab-pane label="历史订单" name="historyGood">
        <historyGood></historyGood>
      </el-tab-pane>
    </el-tabs>
    <div v-if="noComfirm" style="margin-left: 20px ;margin-top: 20px">
      <el-empty description="您还未完善个人信息哦！">
      </el-empty>
    </div>


  </div>
</template>

<script>
  import GoodManage from '../../components/good/GoodManage'
  import HanderGood from '../../components/good/HanderGood'
  import historyGood from '../../components/good/historyGood'

  export default {
    name: 'GoodData',
    data(){
      return{
        user:JSON.parse(window.sessionStorage.getItem('user')),
        activeName:'GoodManage',
        comfirm:false,
        noComfirm:false,
      }
    },
    mounted(){
      this.initComfirm();
    },
    methods: {
      //查询认证信息
      initComfirm(){
        this.postRequest('/personal/data/comfirmByuserId/'+this.user.userId).then(resp => {
          if (resp.code===200) {
            if (resp.message==='ok'){
              this.comfirm=true
            } else{
              this.noComfirm=true;
            }
          }else if(resp.code===500){
            this.noComfirm=true;
          }
        })
      }
    },
    components:{
      GoodManage,
      HanderGood,
      historyGood
    }
  }

</script>

<style scoped>

</style>
